# coding=utf-8
class B:
    @staticmethod
    def a():
        print 'raise in a'
    pass
class C(B):
    pass
class D(C):
    pass

for c in [B, C, D]:
    try:
        # print c.__name__,c.a()
        raise c(), c.a()
    except D:
        print "D"
    except C:
        print "C"
    except B:
        print "B"
